#!/usr/bin/env python
# -*- coding: UTF-8 -*-
"""
@Project : gtmsAutoTestProject 
@File    : overseas_upload_order_payload_interface.py
@IDE     : PyCharm 
@Author  : Mario
@Date    : 2022/9/26 18:08 
@Describe: 海外订单数据组装接口入口
"""
from fastapi import APIRouter
from Comm.logUtils.logControl import LogHandler
from FastApi.dto.pos.order.overseas_upload_order_payload_dto import OverseasUploadOrderPayloadDtoModel
from FastApi.server.pos.order.overseas_upload_order_payload_server import OverseasUploadOrderPayloadServer

logger = LogHandler().get_logger()
getOverseasUploadData_route = APIRouter()


@getOverseasUploadData_route.post("/get-upload-data", name="获取海外物业订单上传数据")
async def getOverseasUploadData(payload: OverseasUploadOrderPayloadDtoModel):
    logger.info('请求参数:[{}]'.format(payload))
    data_upload_request = OverseasUploadOrderPayloadServer(payload.brandCode, payload.environment)
    result_info = data_upload_request.get_overseas_upload_data()
    logger.info('接口响应:[{}]'.format(result_info))
    return result_info
